package cn.ilovese.collect.po.transaction;

import cn.ilovese.collect.vo.transaction.TransactionDetailVO;
import cn.ilovese.collect.vo.user.UserVO;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import java.util.Date;

@NoArgsConstructor
public class Transaction {
    private Integer id;

    private String transactionNumber;

    private String type;

    private Date time;

    private Integer in;

    private Integer out;

    private Double balance;

    private String remark;

    private Integer userId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTransactionNumber() {
        return transactionNumber;
    }

    public void setTransactionNumber(String transactionNumber) {
        this.transactionNumber = transactionNumber == null ? null : transactionNumber.trim();
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getIn() {
        return in;
    }

    public void setIn(Integer in) {
        this.in = in;
    }

    public Integer getOut() {
        return out;
    }

    public void setOut(Integer out) {
        this.out = out;
    }

    public Double getBalance() {
        return balance;
    }

    public void setBalance(Double balance) {
        this.balance = balance;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Transaction(@NonNull TransactionDetailVO transaction){
        id=transaction.getId();
        transactionNumber=transaction.getTransactionNumber();
        type=transaction.getType();
        time=transaction.getTime();
        in=transaction.getIn();
        out=transaction.getOut();
        balance=transaction.getBalance();
        remark=transaction.getRemark();
    }
}